package com.zsxb.crm.controller;

import com.zsxb.crm.annotation.Log;
import com.zsxb.crm.dto.SystemLogPageDTO;
import com.zsxb.crm.result.PageResult;
import com.zsxb.crm.result.Result;
import com.zsxb.crm.service.SystemLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/monitor/operlog")
public class SystemLogController {
    @Autowired
    private SystemLogService systemLogService;

    @GetMapping("/list")
    public PageResult pageQuery(SystemLogPageDTO systemLogPageDTO) {
        PageResult pageResult =  systemLogService.pageQuery(systemLogPageDTO);
        return PageResult.success(pageResult);
    }

    @DeleteMapping("/{ids}")
    @Log
    public Result<?> delete(@PathVariable List<Integer> ids) {
        systemLogService.delete(ids);
        return Result.success();
    }

}
